//
//  ViewController.m
//  拖动
//
//  Created by student on 16/2/29.
//  Copyright © 2016年 niit. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    UIButton *button1=[[UIButton alloc]initWithFrame:CGRectMake(0,0, 60, 60)];
    [button1 setTitle:@"新闻0" forState:normal];
    UIButton *button2=[[UIButton alloc]initWithFrame:CGRectMake(60,0, 60, 60)];
    [button2 setTitle:@"新闻1" forState:normal];
    UIButton *button3=[[UIButton alloc]initWithFrame:CGRectMake(120,0, 60, 60)];
    [button3 setTitle:@"新闻2" forState:normal];
  UIScrollView *scrollview=[[UIScrollView alloc]initWithFrame:CGRectMake(0, 20, 420, 50)];
    scrollview.backgroundColor = [UIColor grayColor];
    scrollview.bounces=YES;
    scrollview.showsHorizontalScrollIndicator=YES;
    scrollview.indicatorStyle=UIScrollViewIndicatorStyleWhite;
    scrollview.contentSize=CGSizeMake(600, 0);
    [scrollview addSubview:button1];
    [scrollview addSubview:button2];
    [scrollview addSubview:button3];
    [self.view addSubview:scrollview];
    
    
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
